package com.forum.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.forum.dao.OrderrefundDao;
import com.forum.entity.OrderrefundEntity;
import com.forum.entity.view.OrderrefundView;
import com.forum.service.OrderrefundService;
import com.forum.utils.MyQuery;
import com.forum.utils.PageUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单退款表 服务实现类
 * </p>
 *
 * @author 张继成
 * @since 2023-12-31
 */
@Service
public class OrderrefundServiceImpl extends ServiceImpl<OrderrefundDao, OrderrefundEntity> implements OrderrefundService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<OrderrefundEntity> page = this.selectPage(
                new MyQuery<OrderrefundEntity>(params).getPage(),
                new EntityWrapper<OrderrefundEntity>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<OrderrefundEntity> wrapper) {
        Page<OrderrefundView> page =new MyQuery<OrderrefundView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    /*@Override
    public List<DingdantuikuanVO> selectListVO(Wrapper<OrderrefundEntity> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public DingdantuikuanVO selectVO(Wrapper<OrderrefundEntity> wrapper) {
        return baseMapper.selectVO(wrapper);
    }*/

    @Override
    public List<OrderrefundView> selectListView(Wrapper<OrderrefundEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public OrderrefundView selectView(Wrapper<OrderrefundEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }

}
